#include <head.h>

int main(int argc, char const *argv[])
{
    int fd_1 = open( "01.txt" , O_RDWR | O_CREAT , 0666 );
    if(-1 == fd_1)
    {
        perror("文件打开失败");
        return 0;
    }
    int fd_2 = open( "02.txt" , O_RDWR | O_CREAT , 0666 );
    if(-1 == fd_2)
    {
        perror("文件打开失败");
        return 0;
    }

    int byte = 0;
    char buf[1024] = "a";

    while (byte = read(fd_1 , buf , sizeof(buf)))
    {
        write(fd_2 , buf , byte);
    }
    


    close(fd_1);
    close(fd_2);
    return 0;
}
